package com.danco.training.serialization;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

import com.danco.training.property.PropertyAccess;

public class FileLoaderUtil {
	
	public static Object load(){
		try{
			String fileName = PropertyAccess.getSerializationFile();
	
		FileInputStream is = new FileInputStream(fileName);
		ObjectInputStream ois = new ObjectInputStream(is);
		while(is.available()>0){
            Object object = ois.readObject();
		
		return object;
		}
		}catch(ClassNotFoundException e){
		e.printStackTrace();
		}catch(IOException e){
		e.printStackTrace();
		}
		return null;
		
		
		}

}
